package com.ycuwq.datepicker.interpolator;

/**
 * Cycle interpolator
 */
public class CycleInterpolator extends BaseInterpolator {
    /**
     * M cycles
     */
    private final float mCycles;


    /**
     * Cycle interpolator
     *
     * @param cycles cycles
     */
    public CycleInterpolator(float cycles) {
        mCycles = cycles;
    }

    /**
     * Get interpolation float
     *
     * @param input input
     * @return the float
     */
    public float getInterpolation(float input) {
        return (float) (Math.sin(2 * mCycles * Math.PI * input));
    }

}

